<!--  -->
<template>
    <div>
        <!-- 表头 -->
        <div class="font15 mt10 pl10">
            <span class="titletext ">{{ (fromdata.titile) ? fromdata.title : '第一议题' }}</span>
            <div class="graytext  mt10 font13">
                <span>发起人：</span>
                <span class="titletext">{{ fromdata.applyUser }}</span>
            </div>

        </div>

                    
        <!-- 基本信息 置灰 -->
        <div class="font11 mt10 bggray ptandpb10">
    
            <div class=" graytext pl10">
                <span >发起人：</span>
                <span class="titletext">{{ fromdata.applyUser }}</span>
            </div>

            <div class=" graytext pl10 mt10">
                <span >发起人单位：</span>
                <span class="titletext">{{ fromdata.applyCompany }}</span>
            </div>

            <div class=" graytext pl10 mt10">
                <span >发起人部门：</span>
                <span class="titletext">{{ fromdata.applyDept }}</span>
            </div>
        </div>

        <!-- 表单信息 -->
        <div>

        <van-field readonly required input-align="left" label-width="2.5em"
                name="applyDate" :value="fromdata.applyDate" label="时间:"
                :rules="[{ required: true, message: '' }]" />

        <van-field readonly required input-align="left" label-width="4.5em"
            name="learnForm" :value="fromdata.learnForm" label="学习形式:"
            :rules="[{ required: true, message: '' }]" />
        
        <van-field readonly input-align="left" label-width="8.5em"
        name="count" :value="fromdata.count" label="部署落实举措条数:"/>

        <van-field readonly input-align="left" label-width="2.5em"
        name="title" :value="fromdata.title" label="标题:" />

        <van-field readonly input-align="left" label-width="4.5em"
        name="participants" :value="fromdata.participants" label="参加人员:"/>

        <van-field type="textarea" autosize
            readonly required input-align="left" label-width="4.5em"
            name="remark" :value="fromdata.remark" label="学习内容:"
            :rules="[{ required: true, message: '' }]" />


        </div>

        <!-- 附件 -->
        <van-field label-width="10em" readonly label="附件:" class="lyy-width" input-align="left" placeholder="">
        </van-field>
        <div v-for="(fileitem) in fromdata.formFiles" :key="fileitem.id" style="margin-left:20px">
            <div readonly class="font14 fileLink" style="color:#0F85CF">
                <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
            </div>
        </div>
    </div>
</template>

<script>
import { getDYYTTZDetail } from '@/api/dwdyytAPI'
import { mapGetters } from "vuex"
import { Notify, Toast } from 'vant'
import { openFileUrl } from '@/store/openFile'
export default {
    data() {
        return {
            fromdata: {},
            params: this.$route.query
        }
    },
    computed: {
        ...mapGetters(['user'])
    },
    //生命周期--创建完成
    created() {
        this.getdetail();
    },
    //生命周期--挂载完成 
    mounted() {

    },
    //方法调用
    methods: {
        openFileUrlfun(value) {
            this.$router.push(
                {
                    name: 'fileview',
                    query: {
                        openFileUrl: openFileUrl(value)
                    }
                }
            );
        },

        getdetail() {
            Toast.loading({
                message: '加载中',
                forbidClick: false
            });

            getDYYTTZDetail(Object.assign(this.params, { userName: this.user.userName }))
                .then((result) => {
                    this.fromdetal = {};
                    Toast.clear();
                    if (!result.data) {
                        Notify(result.message);
                        return;
                    }

                    if (result.data.data) {
                        this.fromdata = result.data.data;
                        if (!result.data.data.formFiles) {
                            this.fromdata.formFiles = [];
                        }
                    }
                })
        }
    }
}
</script>

<style  scoped>
/* @import url();*/
</style>